$(document).ready( function() {

  $("#registerId").validate({
    rules: {
      "uname" : {
          required: true,
          minlength: 5,
      },
      "email" : {
          required: true,
          email: true,
          remote:'ajax/check_email.php'
      },
      "password" : {
          required: true,
          minlength: 8,
      },
      "conPassword" : {
          equalTo:'#passwordId'
      },
      "gender" : {
          required:true
      },
      "dob" : {
          required:true,
          dateISO:true
      },
      "address" : {
          required:true,
          minlength: 10,
      },
      "country" : {
          required:true,
      },
      "lang[]" : {
          required:true,
          minlength: 2,
      },
      "hobbies[]" : {
          required:true,
          minlength: 3,
      },
      "avatar" : {
          required:true,
          accept: 'gif|jpeg|jpg|png',
      },
    },
    messages:{
      "uname" : {
          required: "Name is required",
          minlength: $.format("Name should be {0} characters long."),
      },
      "avatar" : {
          required: "Please upload Avatar",
          accept: $.format("Please upload file with {0} extn."),
      },

    }
 });

});
